package org.lee.status.app.event;

import org.lee.status.app.Result;
import org.lee.status.app.State;
import org.lee.status.app.activity.ActivityService;
import org.lee.status.app.activity.Status;

/**
 * CheckState
 * 提审
 *
 * @author dralee
 * @date 2021-11-24 09:43:21
 **/
public class CheckState extends State {
    @Override
    public Result arraignment(String activityId, Status currentStatus) {
        return Result.failure("待审核状态不可重复提审");
    }

    @Override
    public Result checkPass(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.PASS);
        return Result.failure("活动审核通过完成");
    }

    @Override
    public Result checkRefuse(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.REFUSE);
        return Result.failure("活动审核拒绝完成");
    }

    @Override
    public Result checkRevoke(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.EDITING);
        return Result.failure("活动审核撤消回到编辑中");
    }

    @Override
    public Result close(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.CLOSE);
        return Result.success("活动审核关闭完成");
    }

    @Override
    public Result open(String activityId, Status currentStatus) {
        return Result.failure("非关闭活动不可开启");
    }

    @Override
    public Result doing(String activityId, Status currentStatus) {
        return Result.failure("待审核中不可执行活动中变更");
    }
}
